<?phpnamespace app\common\model;use think\Db;use think\Exception;use think\Model;class TopicArticle extends Model{    public static function getTopic($article_id = ''){        try{            $con = [                'b.is_delete'=>2,                'b.is_show'=>1,            ];            if(!empty($article_id)){                $con['a.article_id'] = $article_id;            }            $join = [                ['topic b', 'a.topic_id = b.id', 'left'],            ];            $topic = Db::name('topic_article')->alias('a')->where($con)                ->order('a.id desc')                ->field('b.*')                ->join($join)                ->select();            return ['code'=>0,'data'=>$topic];        }catch(\Exception $exception) {            return ['code' => 1, 'data' => [], 'msg' => $exception->getMessage()];        }    }}